<template>
  <div class="my-account-box">
    <div class="account-information">
      <div class="top-title">{{ "ACCOUNT INFORMATION" }}</div>
      <div class="account-container">
        <div>
          <strong>{{ "Contact Information" }}</strong>
          <div>
            <p class="information-name">
              {{firstname + " " + lastname}}
              <br />
              {{email}}
            </p>
            <div class="information-span">
              <span @click="_jump(5)">{{'Edit'}}</span>
              <span @click="_jump(5)">{{'Change Password'}}</span>
            </div>
          </div>
        </div>
        <div>
          <strong>{{ "Newsletters" }}</strong>
          <p>{{ 'You are subscribed to "General Subscription".' }}</p>
          <div>
            <span @click="_jump(8)">{{ "Edit" }}</span>
          </div>
        </div>
      </div>
    </div>
    <div class="address-book">
      <div class="top-title">
        <div>{{ "ADDRESS BOOK" }}</div>
        <strong @click="_jump(4)">{{ "Manage Addresses" }}</strong>
      </div>
      <div class="account-container">
        <div>
          <strong>{{ "Default Billing Address" }}</strong>
          <div>
            <p>{{ "You have not set a default billing address." }}</p>
            <div>
              <span @click="_jump(4)">{{ "Edit Address" }}</span>
            </div>
          </div>
        </div>
        <div>
          <strong>{{ "Default Shipping Address" }}</strong>
          <p>{{ "You have not set a default shipping address." }}</p>
          <div>
            <span @click="_jump(4)">{{ "Edit Address" }}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import {mapGetters} from 'vuex'
export default {
  name: "",
  props: [""],
  data() {
    return {};
  },

  components: {},

  computed: {
		...mapGetters(['firstname', 'lastname', 'email'])
	},

  beforeMount() {},

  mounted() {},

  methods: {
		_jump(adress) {
			this.$emit('jump', adress);
		}
	},

  watch: {}
};
</script>
<style lang="scss" scoped>
.my-account-box {
  & > div {
    padding: 20px;
    border: 1px solid #e1e1e1;
    overflow: hidden;
    &.account-information {
      margin-bottom: 40px;
    }
    .top-title {
      border-bottom: 1px solid #e1e1e1;
      padding-bottom: 13px;
      font-size: 18px;
      margin-bottom: 15px;
      // font-weight: 700;
    }
    &.address-book {
      & > .top-title {
        display: flex;
        justify-content: space-between;
        strong {
          font-size: 14px;
        }
      }
    }
    .account-container {
      display: flex;
      font-size: 14px;
			margin-bottom: 20px;
			.information-name {
				line-height: 25px;
			}
      & > div {
        width: 50%;
        strong {
          padding-bottom: 10px;
          margin-bottom: 5px;
        }
				span {
					cursor: pointer;
				}
				.information-span {
					& > span {
						&:first-child {
							padding-right: 15px;
							border-right: 1px solid #a6a6a6;
							margin-right: 10px;
						}
					}
				}
      }
    }
  }
}
</style>
